﻿using KAs.Common.Const;
using KAs.SqlSugar.Entity.Interface;
using SqlSugar;

namespace KAs.SqlSugar.Entity;

[SugarTable("Sys_SimpleDiffLog", "自动审计差异记录")]
public class SimpleDiffLog : SnowflakeIdEntity, ICreateEntity
{
    [SugarColumn(ColumnDescription = "表名")]
    public string TableName { get; set; }
    [SugarColumn(ColumnDescription = "操作类型(insert,update,delete)")]
    public string DiffType { get; set; }

    [SugarColumn(ColumnDataType = ConstConfig.TEXT, IsJson = true, ColumnDescription = "操作前结构信息")]
    public List<DiffLogTableInfo> BeforeData { get; set; }

    [SugarColumn(ColumnDataType = ConstConfig.TEXT, IsJson = true, ColumnDescription = "操作后结构信息")]
    public List<DiffLogTableInfo> AfterData { get; set; }

    [SugarColumn(ColumnDataType = ConstConfig.TEXT, ColumnDescription = "操作sql")]
    public string Sql { get; set; }

    [SugarColumn(IsNullable = true)]
    public DateTime? CreateTime { get; set; }

    public string CreateUid { get; set; }
}
